import request from '@/utils/request'

// 查询动物信息回溯列表
export function listHistory(query) {
  return request({
    url: '/animal/history/list',
    method: 'get',
    params: query
  })
}

// 查询动物信息回溯详细
export function getHistory(historyId) {
  return request({
    url: '/animal/history/' + historyId,
    method: 'get'
  })
}

// 查询动物信息回溯详细
export function getHistoryByAnimalId(animalId) {
  return request({
    url: '/animal/history/getInfoByAnimalId/' + animalId,
    method: 'get'
  })
}

// 新增动物信息回溯
export function addHistory(data) {
  return request({
    url: '/animal/history',
    method: 'post',
    data: data
  })
}

// 修改动物信息回溯
export function updateHistory(data) {
  return request({
    url: '/animal/history',
    method: 'put',
    data: data
  })
}

// 删除动物信息回溯
export function delHistory(historyId) {
  return request({
    url: '/animal/history/' + historyId,
    method: 'delete'
  })
}
